#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <memory>

using namespace std;

int firstUniqChar(string s) { //leetcode
    map<char, int> m;
    for (int i = 0; i < s.length(); ++i) {
        if (m.count(s[i]) >= 1) {
            map<char, int>::iterator iter = m.find(i + 1);
            cout << iter->first << endl;
        } else {
            m.insert(pair<char, int>(s[i], 1));
        }
    }
    map<char, int>::iterator iter;
    for (int i = 1; i < m.size(); ++i) {
        iter = m.find(i);
        cout << iter->first << "," << iter->second << endl;

    }
    return -1;
}

int main() {
    string s = "hello";
    cout << firstUniqChar(s) << endl;

    return 0;
}